/*
 * Copyright (c) 2024 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SYSVPN_KEYSTORE_H
#define SYSVPN_KEYSTORE_H

#include <credentials/certificates/certificate.h>
#include <credentials/certificates/x509.h>
#include <credentials/sets/mem_cred.h>
#include <plugins/stroke/stroke_ca.h>
#include <sa/ike_sa.h>

int keystore_load_ca_cert(stroke_ca_t *ca, mem_cred_t *creds);

certificate_t *keystore_load_user_cert();

status_t keystore_ikev1_sign(ike_sa_t *ike_sa, bool initiator, key_exchange_t *dhke, chunk_t dh_value,
							 chunk_t sa_payload, chunk_t id_payload, message_t *message, identification_t *id);

status_t keystore_ikev2_sign(ike_sa_t *ike_sa, chunk_t ike_sa_init, char *reserved, chunk_t ppk, chunk_t nonce,
							 message_t *message, identification_t *id);

#endif // SYSVPN_KEYSTORE_H
